﻿using System.IO;

using YTS.Log;

namespace IOFileServer.Test
{
    public static class FileExtend
    {
        public static void WriteAllText(string path, string content)
        {
            FileInfo file = new FileInfo(path);
            if (!file.Directory.Exists)
            {
                file.Directory.Create();
            }
            File.WriteAllText(file.FullName, content);
        }

        public static string GetTestDirePath()
        {
            string testDirePath = Path.Combine(ILogExtend.GetApplicationDirectoryAddress(),
                $"./_test_dire/{Faker.Identification.UkNationalInsuranceNumber()}");
            testDirePath = new DirectoryInfo(testDirePath).FullName;
            return testDirePath;
        }
    }
}
